<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2018/5/19
 * Time: 10:38
 */

namespace app\bean;


class GraphArticleBean extends Bean
{
    private $id;
    private $editer_id;
    private $content;
    private $graph;
    private $add_time;
    private $is_top;
    private $status;
    private $head_image;
    private $nickname;
    private $editer_type;
    private $add_time_timestamp;

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return mixed
     */
    public function getEditerId()
    {
        return $this->editer_id;
    }

    /**
     * @param mixed $editer_id
     */
    public function setEditerId($editer_id)
    {
        $this->editer_id = $editer_id;
    }

    /**
     * @return mixed
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * @param mixed $content
     */
    public function setContent($content)
    {
        $this->content = $content;
    }

    /**
     * @return mixed
     */
    public function getGraph()
    {
        $graph =  json_decode($this->graph,true);
        return $graph;
    }

    /**
     * @param mixed $graph
     */
    public function setGraph($graph)
    {
        $this->graph = $graph;
    }

    /**
     * @return mixed
     */
    public function getAddTime()
    {
        return $this->add_time;
    }

    /**
     * @param mixed $add_time
     */
    public function setAddTime($add_time)
    {
        $this->add_time = $add_time;
    }

    /**
     * @return mixed
     */
    public function getisTop()
    {
        return $this->is_top;
    }

    /**
     * @param mixed $is_top
     */
    public function setIsTop($is_top)
    {
        $this->is_top = $is_top;
    }

    /**
     * @return mixed
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @param mixed $status
     */
    public function setStatus($status)
    {
        $this->status = $status;
    }

    /**
     * @return mixed
     */
    public function getHeadImage()
    {
        return $this->head_image;
    }

    /**
     * @param mixed $head_image
     */
    public function setHeadImage($head_image)
    {
        $this->head_image = $head_image;
    }

    /**
     * @return mixed
     */
    public function getNickname()
    {
        if($this->getEditerType() == 1){
             return  "央视新闻记者 ".$this->nickname;
        }else{
            return "央视小编 ".$this->nickname;
        }
    }

    /**
     * @param mixed $nickname
     */
    public function setNickname($nickname)
    {
        $this->nickname = $nickname;
    }

    /**
     * @return mixed
     */
    public function getEditerType()
    {
        return $this->editer_type;
    }

    /**
     * @param mixed $editer_type
     */
    public function setEditerType($editer_type)
    {
        $this->editer_type = $editer_type;
    }

    /**
     * @return mixed
     */
    public function getAddTimeTimestamp()
    {
        if($addTime = $this->getAddTime()){
            return @strtotime($addTime);
        }else{
            return $this->add_time_timestamp;
        }
    }

    /**
     * @param mixed $add_time_timestamp
     */
    public function setAddTimeTimestamp($add_time_timestamp)
    {
        $this->add_time_timestamp = $add_time_timestamp;
    }

}